package com.springboot.hotel.xencryption;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
//无参构造
@NoArgsConstructor
//有参构造
@AllArgsConstructor
public class R {
    private Integer code;
    private String msg;
    private Object data;
    public static R ok(String msg, Object data){
        return new R(200, msg, data);
    }

    public static R ok(String msg){
        return new R(200, msg, null);
    }
    public static R ok(Object data){
        return new R(200, "操作成功", data);
    }

    public static R fail(String msg){
        return new R(500, msg, null);
    }

}
